﻿%======================================================================
%----------------------------------------------------------------------
%               XX                           X
%                                            X
%               XX    XXX   XXX   XXX   XXX  X  XXXX
%                X   X   X X   X X   X X   X X X
%                X   XXXXX XXXXX XXXXX X     X  XXX
%                X   X     X     X     X   X X     X
%               XXX   XXX   XXX   XXX   XXX  X XXXX
%----------------------------------------------------------------------
%               SPECIFICATION FOR COMMON IEEE STYLES
%----------------------------------------------------------------------
%               Gregory L. Plett, Istv\'{a}n Koll\'{a}r.
%======================================================================
\documentclass[%
    %draft,
    %submission,
    %compressed,
    a4paper,
    %12pt,
    10pt,
    final,
    %technote,
    %internal,
    %submitted,
    %inpress,
    %reprint,
    %titlepage,
    notitlepage,
    %anonymous,
    narroweqnarray,
    inline,
    oneside,
    %invited,
    %conference
    article
    ]{ieee}

%\documentclass[a4paper,12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}

\newcommand{\latexiie}{\LaTeX2{\Large$_\varepsilon$}}

%\usepackage{ieeetsp}    % if you want the "trans. sig. pro." style
%\usepackage{ieeetc}    % if you want the "trans. comp." style
%\usepackage{ieeeimtc}    % if you want the IMTC conference style

% Use the `endfloat' package to move figures and tables to the end
% of the paper. Useful for `submission' mode.
%\usepackage {endfloat}

% Use the `times' package to use Helvetica and Times-Roman fonts
% instead of the standard Computer Modern fonts. Useful for the
% IEEE Computer Society transactions.
%\usepackage{times}
% (Note: If you have the commercial package `mathtime,' (from
% y&y (http://www.yandy.com), it is much better, but the `times'
% package works too). So, if you have it...
%\usepackage {mathtime}

% for any plug-in code... insert it here. For example, the CDC style...
%\usepackage{ieeecdc}

\begin{document}

%----------------------------------------------------------------------
% Title Information, Abstract and Keywords
%----------------------------------------------------------------------
\title[]{
  Trabajo Práctico Especial preliminar 2: Redes Neuronales}

% format author this way for journal articles.
% MAKE SURE THERE ARE NO SPACES BEFORE A \member OR \authorinfo
% COMMAND (this also means `don't break the line before these
% commands).
%\author[PLETT AND KOLL\'{A}R]{Gregory L. Plett\member{Student
%       Member},\authorinfo{G.\,L.\,Plett is with the Department of Electrical
%       Engineering, Stanford University, Stanford, CA 94305--9510.
%       Phone: $+$1\,650\,723--4769, e-mail: glp@simoon.stanford.edu}%
%\and{}and Istv\'{a}n Koll\'{a}r\member{Fellow}\authorinfo{I.\
%       Koll\'{a}r is with the Department of Measurement and Information
%       Systems, Technical University of Budapest, 1521 Budapest, Hungary.
%       Phone: $+$\,36\,1\,463--1774, fax: +\,36\,1\,463--4112,
%       e-mail: kollar@mmt.bme.hu}
%}
\author{
     Alan Idesis,
\and Mar\'ia Eugenia Cura,
\and Tom\'as Alvarez
}

% format author this way for conference proceedings
%\author[PLETT AND KOLL\'{A}R]{%
        %Gregory L. Plett\member{Student Member},\authorinfo{%
        %Department of Electrical Engineering,\\
        %Stanford University, Stanford, CA 94305-9510.\\
        %Phone: $+$1\,650\,723-4769, email: glp@simoon.stanford.edu}%
%\and{}and%
%\and{}Istv\'{a}n Koll\'{a}r\member{Fellow}\authorinfo{%
        %Department of Measurement and Instrument Engineering,\\
        %Technical University of Budapest, 1521 Budapest, Hungary.\\
        %Phone: $+$\,36\,1\,463-1774, fax: +\,36\,1\,463-4112,
        %email: kollar@mmt.bme.hu}
%}

%\journal{IEEE Trans.\ on Instrum.\ Meas.}
%\titletext{, VOL.\ 46, NO.\ 6, DECEMBER\ 1997}
%\ieeecopyright{0018--9456/97\$10.00 \copyright\ 1997 IEEE}
%\lognumber{xxxxxxx}
%\pubitemident{S 0018--9456(97)09426--6}
%\loginfo{Manuscript received September 27, 1997.}
%\firstpage{1217}

%\confplacedate{Ottawa, Canada, May 19--21, 1997}

\maketitle

%\begin{keywords}
%Style file, \latexiie, Microsoft Word, IEEE Publications, Instrumentation
%and Measurement Technology Conference, IMTC.
%\end{keywords}

%----------------------------------------------------------------------
% SECTION I: Introduction
%----------------------------------------------------------------------
\section{Introducci\'on}

\PARstart EN el presente trabajo se detalla el desarrollo de como se ha implementado una red neuronal con aprendizaje supervisado que resuelve el problema del \textbf{OR} y el \textbf{AND} l\'ogico, con \textit{N} entradas, con $2 \le N \le 5$. 

Para esto se ha implementado un perceptr\'on simple con \textit{N} entradas en MATLAB (compatible con Octave).

En el informe se expondran las consideraciones que han sido tomadas en cuenta al dise\~narla y entrenarla y los resultados obtenidos como asi tambi\'en las conclusiones alcanzadas.

\section{Desarrollo}
Los par\'ametros que se han considerado son los siguientes:
\begin{itemize}
 \item $g(h)$: Funci\'on de activaci\'on.
 \item $\eta$: Constante de proporcionalidad del aprendizaje.
 \item \textit{N}: Candidad de entradas del perceptr\'on.
 \item $\beta$: La forma que tomar\'a la funci\'on de activaci\'on.
\end{itemize}

Las funciones de activaci\'on que se utilizaron para el entrenamiento de la red son: dos no-lineales (tangencial hiperb\'olica y exponencial), una lineal y una escalonada, $g(h)=tanh(\beta h)$, $g(h)=(1+e^{(-2\beta h)})^{-1}$, $g(h)=h$ y $g(h)=sign(h)$ respectivamente.

Se inicializa el perceptr\'on de $N+1$ neuronas en la capa de entrada ($+1$ representando el umbral) con pesos aleatorios. Para calcular el valor de salida en cada iteraci\'on, se toma un patr\'on al azar del conjunto de entrenamiento y se le aplicanda la funci\'on $g$ a la suma pesada de las entradas multiplicadas por los pesos.

Se debe aclarar que para la implementaci\'on de este trabajo se realiz\'o el m\'etodo de actualizaci\'on de pesos incremental, ya que se actualizan los mismos cada vez que se termina de entrenar con un patr\'on, y no al final de cada \'epoca. Se corrigen los pesos sumando un $\Delta w$ el cual depende de $\eta$, los patrones de entrada, la salida esperada y la salida obtenida.


\section{Resultados obtenidos}
Los resultados expuestos se obtuvieron con los siguientes parametros de entrada:
\begin{itemize}
 \item $\eta$: ?? Esto va a variarrr????
 \item \textit{N}: 5
 \item $\beta$: 0.5
\end{itemize}

\subsection{AND}
 GRAFICOS!
\begin{center}
\begin{tabular}{l c c c c}
\hline
\hline
\textbf{} & \textbf{Escal\'on} & \textbf{Lineal} & \textbf{Tangencial} & \textbf{Exponencial} \\
\hline
\hline
\textbf{\'Epocas} & 200 & 200 & 200 & 200 \\
\textbf{Error} & 200 & 200 & 200 & 200 \\
\end{tabular}
\end{center}


O??? cual de estas dos tablas?? (la anterior o la siguiente)

\begin{center}
\begin{tabular}{l c c c c}
\hline
\hline
\textbf{} & \textbf{Escal\'on} & \textbf{Lineal} & \textbf{Tangencial} & \textbf{Exponencial} \\
\hline
\hline
\textbf{$\eta = 0.01$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.05$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.1$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.5$} & 200 & 200 & 200 & 200 \\
\end{tabular}
\end{center}

\subsection{OR}
GRAFICOS!

\begin{center}
\begin{tabular}{l c c c c}
\hline
\hline
\textbf{} & \textbf{Escal\'on} & \textbf{Lineal} & \textbf{Tangencial} & \textbf{Exponencial} \\
\hline
\hline
\textbf{\'Epocas} & 200 & 200 & 200 & 200 \\
\textbf{Error} & 200 & 200 & 200 & 200 \\
\end{tabular}
\end{center}


O??? cual de estas dos tablas?? (la anterior o la siguiente)

\begin{center}
\begin{tabular}{l c c c c}
\hline
\hline
\textbf{} & \textbf{Escal\'on} & \textbf{Lineal} & \textbf{Tangencial} & \textbf{Exponencial} \\
\hline
\hline
\textbf{$\eta = 0.01$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.05$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.1$} & 200 & 200 & 200 & 200 \\
\textbf{$\eta = 0.5$} & 200 & 200 & 200 & 200 \\
\end{tabular}
\end{center}

\section{Conclusiones y comentarios finales}

Particularmente en este ejercicio se obtienen buenos resultados con valores de $\eta$ cercanos a ??? y valores de $\beta$ cercanos a ???? ya que con valores mas altos la red satura. Esto no garantiza que en otros problemas estos sean los par \'ametros ideales, ya que hay que realizar pruebas emp\'iricas para esto. Por ultimo, vimos que el n\'umero de entradas de la red afecto unicamente en el tiempo de aprendizaje del problema pero no en la aprendibilidad del mismo.

%\begin{thebibliography}{1}
%\bibitem [1]{1} http://www.mindjolt.com/games/fill-zone
%\end{thebibliography}

\clearpage

\begin{figure}
        \centering
%    \includegraphics[width=6cm]{images//tablero.png}
        \caption{AND: Grafico bla bla}
        \label{fig1}
\end{figure}

\begin{figure}
        \centering
%    \includegraphics[width=6cm]{images//tablero.png}
        \caption{OR: Grafico bla bla}
        \label{fig2}
\end{figure}

%----------------------------------------------------------------------
% SECTION
%----------------------------------------------------------------------

%\section{Resultados y conclusi\'on}

%Es interesante que observemos como algoritmos como el de L'Ecuyer, que generan n\'umeros pseudo-aleatorion, son de enorme utilidad para una amplia cantidad de estudio de modelos y an\'alisis. En este caso nos resulta clave para abordar el del sistema de propulsión del USS Enterprise.

%\begin{thebibliography}{1}

%\bibitem{lamport}
%Leslie Lamport,
%\newblock {\em A Document Preparation System: {\LaTeX} User's Guide and
%  Reference Manual},
%\newblock Addison-Wesley, Reading, MA, 2nd edition, 1994.
%\newblock Be sure to get the updated version for \latexiie!

%\bibitem{goossens}
%Michel Goossens, Frank Mittelbach, and Alexander Samarin,
%\newblock {\em The {\LaTeX} Companion},
%\newblock Addison-Wesley, Reading, MA, 1994.

%\end{thebibliography}
%\begin{thebibliography}{2}
%\bibitem [1]{1} Apostol T.M., \textit{Volumen 1. Calculus. Segunda Edición}, Reverté, 1982
%\bibitem [2]{2} Mathews J.H., Fink K.D., \textit{Métodos Numéricos con Matlab. Tercera Edición}, Prentice Hall, 2003
%\end{thebibliography}

%----------------------------------------------------------------------

%\begin{biography}{Gregory L. Plett}
%(S'97) was born in Ottawa, ON, in 1968. He received the B.Eng.\ degree
%in computer systems engineering with high distinction from Carleton
%University, Ottawa, in 1990, and the M.S.\ degree in electrical
%engineering from Stanford University, CA, in 1992.  He is currently a
%Ph.D.\ candidate at Stanford University, where he is researching
%aspects of adaptive control under the supervision of Professor Bernard
%Widrow.
%\end{biography}


%\begin{biography}{Istv\'{a}n Koll\'{a}r}
%(M'87--SM'93--F'97) was born in Budapest, Hungary, in 1954. He graduated
%in electrical engineering from the Technical University of Budapest in
%1977 and in 1985 received the degree ``Candidate of Sciences'' (the
%equivalent of Ph.D.) from the Hungarian Academy of Sciences, and the
%degree dr.tech.\ from the Technical University of Budapest.
%\begin{thebibliography}{1}
%\bibitem [1]{1} Hertz J., Krogh A., Palmer R.G., \textit{Introduction to the theory of neural computation, Westview Press,1991}
%\bibitem [2]{2} Prueba Chi2: http://es.wikipedia.org/wiki/Prueba\_\%CF\%87\%C2\%B2
%\bibitem [3]{3} Prueba de Kolmog\'orov-Smirnov: http://es.wikipedia.org/wiki/Prueba\_de\_Kolmog\'orov-Smirnov
%\end{thebibliography}

%From September 1993 to June 1995, he was a Fulbright Scholar and
%visiting associate professor in the Department of Electrical
%Engineering, Stanford University. He is professor of electrical
%engineering, Department of Measurement and Information Systems,
%Technical University of Budapest. His research interests span the
%areas of digital and analog signal processing, measurement theory, and
%system identification. He has published about 50 scientific papers and
%is coauthor of the book \emph{Technology of Electrical Measurements},
%(L.\ Schnell, ed., Wiley, 1993). He authored the \emph{Frequency
%Domain System Identification Toolbox} for Matlab.
%\end{biography}

\end{document}